/*

#ifndef __Cube_h_
#define __Cube_h_
*/

/*
 * A wrapper class that creates a cube and allows rotations to be done easily.
 * This class will also make it possible to apply textures to the Cube once
 * it is figured out how to apply textures.
 */

#pragma once
#include "GameApplication.h"
#include <vector>
#include "Grid.h"

extern Ogre::SceneManager* sceneMgr; // Defined in main.cpp

class GridNode;

class Cube
{
	private:

	protected:
		Ogre::Entity* mCubeEntity; //The Entity that represents this Cube
		Ogre::SubEntity* faceA; //subEntity of Cube (a face on the cube)
		Ogre::SubEntity* faceB; //subEntity of Cube (a face on the cube)
		Ogre::SubEntity* faceC; //subEntity of Cube (a face on the cube)
		Ogre::SubEntity* faceD; //subEntity of Cube (a face on the cube)
		Ogre::SubEntity* faceE; //subEntity of Cube (a face on the cube)
		Ogre::SubEntity* faceF; //subEntity of Cube (a face on the cube)
		Ogre::SceneNode* mCubeNode;  //The SceneNode that contains this Entity
		Ogre::SceneNode* mCubeSubNode;  //The SceneNode that contains this Entity
		Cube(){};					//Empty default constructor, so we can use it when instantiating a PipeCube from ObstacleCube.changeToPipeCube()
		int iD;				//This Cube's unique (hopefully) iD
		GridNode* myGNode;			//The GridNode at this Cube's location
		std::string type;
	public:
		Cube(Ogre::Vector3 location, std::string type, GridNode* g, Ogre::MeshPtr cubePtr, int iD = -1);	//Constructor with the choice to give the Cube an ID number, location, GridNode, and a type
		virtual ~Cube(){};					//Deletes this Cube
		std::string getName();		//Returns the name of this Cube's SceneNode
		std::string Cube::getType(); //Returns the type of Cube this is
		virtual void update(Ogre::Real deltaTime) = 0;	//This will be used for Cubes inheriting in order to apply their specific functions
		GridNode* getGridNode();		//Returns the this Cube's GridNode
		Ogre::SceneNode* getSceneNode();	//Returns the PipeCube's SceneNode
		void printSubEntitiesToFile(Ogre::Entity* _BodyEntity,char *outFile);
};
//#endif